package com.virtualperson.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        // 映射 /output/** 到 E:/AI/virtualPerson/output/
        registry.addResourceHandler("/output/**")
                .addResourceLocations("file:E:/AI/virtualPerson/output/");

        // 映射 /test_output/** 到 E:/AI/virtualPerson/test_output/
        registry.addResourceHandler("/test_output/**")
                .addResourceLocations("file:E:/AI/virtualPerson/test_output/");

        // 映射 /picture/** 到 E:/AI/virtualPerson/picture/
        registry.addResourceHandler("/picture/**")
                .addResourceLocations("file:E:/AI/virtualPerson/picture/");

        // 映射 /audio/** 到 E:/AI/virtualPerson/audio/
        registry.addResourceHandler("/audio/**")
                .addResourceLocations("file:E:/AI/virtualPerson/audio/");

        // 映射 /uploads/** 到本地uploads目录
        registry.addResourceHandler("/uploads/**")
                .addResourceLocations("file:uploads/");
    }
} 